import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooUnipayConfigController } from '../../../controllers';
const uctoounipayConfigRouter = new Router();
const unipayConfigController = new uctooUnipayConfigController();

uctoounipayConfigRouter.post('/add', requireUser, unipayConfigController.add);
uctoounipayConfigRouter.post('/edit', requireUser, rowLevelPermission('uctoo/unipay_config'), unipayConfigController.edit);
uctoounipayConfigRouter.post('/del', requireUser, rowLevelPermission('uctoo/unipay_config'), unipayConfigController.delete);

//For getting unipayConfig with permission control
uctoounipayConfigRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/unipay_config'), unipayConfigController.getSingle);
uctoounipayConfigRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/unipay_config'), unipayConfigController.getMany);
uctoounipayConfigRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/unipay_config'), unipayConfigController.getMany);

//#endregion AutoCreateCode
export default uctoounipayConfigRouter;
